- /* sffberni.cpp by K.Tsuru */
- // function ID 7100 DRADIX
- /*****************************************************************
- SFraction class
- It provides the n-th Bernoulli's number Bn by use of TanCoeff(n).
- ******************************************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
-
- SFraction BernNum(uint n){
- SLong den;
- if(n >= den.Radix()/2u) den.SetError(den.OUT_OF_RANGE,"BernNum", 7100);
- if(!n){ TanCoeff(0); return 0.0; } // free memory.
-
- SLong Tn2n = (2*n)*TanCoeff(n);
-
- den = Lpow(4, n); // den = 2^(2n)
- den = den*(den -1L);
-
- SFraction r(Tn2n, den);
- r.Reduce();
- return r;
- }
sffberni.cpp : last modifiled at 2008/12/04 15:52:00(648 bytes)
created at 2015/12/22 16:07:29
The creation time of this html file is 2016/09/13 19:56:38 (Tue Sep 13 19:56:38 2016).